package com.sam.designpatterns

abstract class Template {
    fun todayLife() {
        stepOne()
        stepTwo()
        stepThree()
        stepFour()
    }

    private fun stepOne() {
        print("起床，吃饭")
    }
    abstract fun stepTwo()
    abstract fun stepThree()
    abstract fun stepFour()
}

// 肥宅
class Boy : Template() {
    override fun stepTwo() {
        print(" -> 打游戏")
    }

    override fun stepThree() {
        print(" -> 玩手机")
    }

    override fun stepFour() {
        print(" -> 睡觉")
    }
}

// 爱旅游的文青
class Girl : Template() {
    override fun stepTwo() {
        print(" -> 上车睡觉")
    }

    override fun stepThree() {
        print(" -> 下车拍照")
    }

    override fun stepFour() {
        print(" -> 修图发朋友圈")
    }
}

fun main() {
    print("10.1 国庆来啦！来看看宅男们都在干嘛：\n")
    Boy().todayLife()
    print("\n来瞅瞅妹子们在干嘛：\n")
    Girl().todayLife()
    print("\n10.8 国庆结束了！真想再给祖国过一次生日")
}